package com.rundatop.wx.service.impl;


import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import com.rundatop.dao.mapper.BaseBrandMapper;
import com.rundatop.dao.model.BaseBrand;
import com.rundatop.wx.service.BaseBrandService;

import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;

/**
* 通用 Mapper 代码生成器
*
* @author mapper-generator
*/
@Service
public class BaseBrandServiceImpl extends BaseService<BaseBrand> implements BaseBrandService{
	
	@Resource
    private BaseBrandMapper baseBrandMapper;

    
    @Override
	public List<BaseBrand> getList(BaseBrand condition) {
    	Example ex = new Example(BaseBrand.class);

        Example.Criteria c = ex.createCriteria();

        if (isNotBlank(condition.getParentId())) {
            c.andEqualTo("parentId", condition.getParentId());
        } else {
        	c.andIsNull("parentId");
		}

        //if (isNotBlank(condition.getName())) {
        //    c.andLike("name", fullLike(condition.getName()));
        //}

        ex.orderBy("sortNo").asc();

        List<BaseBrand> list = baseBrandMapper.selectByExample(ex);
		return list;
	}

}




